package com.mysoft.gfyx.marketdevelop.controller.tag;

import com.mysoft.framework.modeling.dataapi.DataApi;
import com.mysoft.framework.modeling.dto.OptionItem;
import com.mysoft.framework.mvc.api.Controller;
import com.mysoft.framework.rpc.annotation.PubAction;
import com.mysoft.framework.rpc.annotation.PubService;
import com.mysoft.framework.rpc.contants.RequestPrefix;
import com.mysoft.gfyx.marketdevelop.service.DeveloperService;
import com.mysoft.gfyx.marketdevelop.service.LabelService;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;
import java.util.List;

@PubService(value = "/optionDataApi", prefix = RequestPrefix.API)
@Tag(name = "选项-API")
public class OptionsDataApiController extends Controller implements DataApi {
    @Resource
    private LabelService labelService;

    @PubAction(value = "/companyOptions", method = RequestMethod.POST)
    @ApiOperation(value = "/companyOptions", notes = "企业类型备选项接口")
    public List<OptionItem> companyOptions() {
        return labelService.loadValueTo0ValueTagsByTagName(DeveloperService.TjEntity.Developer, LabelService.LABEL_COMPANY_TYPE);
    }

    @PubAction(value = "/projectTypeOptions", method = RequestMethod.POST)
    @ApiOperation(value = "/projectTypeOptions", notes = "项目类型备选项接口")
    public List<OptionItem> projectTypeOptions() {
        return labelService.loadValueTo0ValueTagsByTagName(DeveloperService.TjEntity.Developer, LabelService.LABEL_PROJECT_TYPE);
    }

    @PubAction(value = "/developerSmartTagOptions", method = RequestMethod.POST)
    @ApiOperation(value = "/developerSmartTagOptions", notes = "企业标签备选项接口")
    public List<OptionItem> developerSmartTagOptions() {
        return labelService.DeveloperSmartTag();
    }

    @PubAction(value = "/developerTagOptions", method = RequestMethod.POST)
    @ApiOperation(value = "/developerTagOptions", notes = "企业标签备选项接口-标准版")
    public List<OptionItem> developerTagOptions() {
        return labelService.DeveloperTag();
    }

    @PubAction(value = "/landTypeOptions", method = RequestMethod.POST)
    @ApiOperation(value = "/landTypeOptions", notes = "土地类型/土地用途备选项接口")
    public List<OptionItem> landTypeOptions() {
        return labelService.loadValueTagsLandType(1);
    }

    @PubAction(value = "/projectPropertyOptions", method = RequestMethod.POST)
    @ApiOperation(value = "/projectPropertyOptions", notes = "建筑性质备选项接口")
    public List<OptionItem> projectPropertyOptions() {
        return labelService.loadValueTagsPrjProperty(1);
    }

    @PubAction(value = "/projectFunctionOptions", method = RequestMethod.POST)
    @ApiOperation(value = "/projectFunctionOptions", notes = "工程用途备选项接口")
    public List<OptionItem> projectFunctionOptions() {
        return labelService.loadValueTagsPrjFunction(1);
    }

    @PubAction(value = "/fitmentTypeOptions", method = RequestMethod.POST)
    @ApiOperation(value = "/fitmentTypeOptions", notes = "装修状态备选项接口")
    public List<OptionItem> fitmentTypeOptions() {
        return labelService.loadValueTo0ValueTagsByTagName(DeveloperService.TjEntity.Developer, LabelService.LABEL_FITMENT_TYPE);
    }

    @PubAction(value = "/industryOptions", method = RequestMethod.POST)
    @ApiOperation(value = "/industryOptions", notes = "行业分类备选项接口")
    public List<OptionItem> industryOptions() {
        return labelService.loadValueTagsIndustry();
    }
}
